<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Config;
class FinancialDetails extends Model
{
    public $timestamps = true;
    protected $table = 'financial_details';
    protected $fillable = [
        'user_id',
        'type',
        'money',
        'balance',
        'note',  
    ];
    //
    
    public function typename(){
        $fund_names = Config::get('system.funds_type');
        return $fund_names[$this->type];
    }

    public function user(){
        
         return $this->belongsTo('App\User','user_id');
    }


}
